/*
 * StrongT - Sistema Web
 * Copyright 2011-2012
 * 
 * Autor               : Enrique Morocco Tupa
 * Fecha Registro      : 25/11/2012 02:01:23 PM
 * Detalle             : UtilDate
 */

package com.strategy.modulo.web.util;

import java.text.ParseException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 *
 * @author Enrique Morocco Tupa
 */
public class UtilAppDate {

    public static Date convertStringToDate(String tVal, String tFormat) {

        Date dato = null;
        DateFormat df = new SimpleDateFormat(tFormat);
        try {
            dato = df.parse(tVal);

        } catch (ParseException ex) {
        }
        return dato;
    }

    public static String convertDateToString(Date tVal, String tFormat) {

        String dato = null;
        SimpleDateFormat sdf = new SimpleDateFormat(tFormat);
        try {
            dato = sdf.format(tVal);
        } catch (Exception ex) {
        }
        return dato;
    }
}
